package com.sam.im.sms.util;

import android.content.Context;
import android.telephony.SmsMessage;
import android.util.Log;

import com.sam.im.sms.R;

/**
 * 描述
 * liuyucheng
 * Created By 刘育成 on 2019/6/5.
 */
public class ToolsUtils {
    private static String content;
    private static boolean mAutoHangup;

    public static boolean Tools(Context context, SmsMessage smsMessage) {
        content = smsMessage.getDisplayMessageBody();
        if (content.contains("回复TD退订")) {
            return true;
        } else if (content.contains("积分提醒")) {
            return true;
        } else if (content.contains("退订回")) {
            return true;
        } else if (content.contains("回T退")) {
            return true;
        } else if (content.contains("登录领取")) {
            return true;
        } else if (content.contains("退订TD")) {
            return true;
        } else if (content.contains("回N退")) {
            return true;
        } else if (content.contains("退订")) {
            return true;
        } else if (content.contains("限时促销")) {
            return true;
        } else if (content.contains("限时大促")) {
            return true;
        } else if (content.contains("无门槛")) {
            return true;
        } else if (content.contains("秒到账")) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean ListTools( String address, String string) {
        Log.e("lyc:::str",string);
        mAutoHangup=false;
        String numberKeywords = string.replaceAll("\\*", "");
        if (!numberKeywords.isEmpty()) {
            for (String ketword : numberKeywords.split(" ")) {
                if (address.startsWith(ketword)) {
                    mAutoHangup = true;
                } else {
                    mAutoHangup = false;
                }
            }
        }
        return mAutoHangup;
    }
}
